<?php
$commands = Array(
  "ls -la /temp/tempdir/",
  "runme -xd -f",
  "dir"
  );

if(isSet($_GET["command"]) && $_GET["command"] != ""){
  $comm = $_GET["command"];
  if(in_array($comm, $commands)){
    $result = `$comm`;
    $result = htmlentities($result);
    echo $result;
  }
  else{
    echo "Niedozwolone polecenie!";
  }
}
else{
  echo "Niepoprawne dane.";
}
?>
